package com.xtaller.easy.admin.mapper;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.xtaller.easy.admin.model.SysOrganizational;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* Created by Taller on 2018/06/02
*/
@Mapper 
public interface SysOrganizationalMapper extends BaseMapper<SysOrganizational> {
    @Select("select a.id,a.loginName,ifnull(b.userId, 0) isIn from base_user a " +
            "left join base_user_organizational b on a.id=b.userId and organizationalId=#{w.organizationalId} " +
            "where a.isDel=0 and a.status=1 and loginName like '%${key}%'")
    List<JSONObject> getByKey(@Param("w") JSONObject object);



}